package com.chat.consumer.rpc;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelOutboundHandlerAdapter;
import io.netty.channel.ChannelPromise;

/**
 * @Auther created by haoteng on 2019/08/16
 */
public class DemoClientOutChannelHandler extends ChannelOutboundHandlerAdapter {

    @Override
    public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {

        ByteBuf req = Unpooled.copiedBuffer((ByteBuf) msg);
        (req).writeBytes("&".getBytes());

        super.write(ctx, req, promise);

    }
}
